#!/bin/bash
# testing if you can write a file
pwfile="/etc/shadow"

if [ -f $pwfile ];then
    echo "$pwfile is a file"
    if [ -w $pwfile ];then
        echo "hello world" >> $pwdfile
    else
        echo "Sorry, I am unable to write the $pwfile file."
    fi
else
    echo "Sorry, the file $pwfile does not exists."
fi

